package nayasis.common;

import java.io.IOException;
import java.nio.file.Path;
import java.util.List;

import nayasis.common.util.FileUtil;

import org.junit.Assert;
import org.junit.Test;


public class FileUtilTest {

	@Test
	public void makeConstructor() throws IOException {

		List<Path> list = FileUtil.getList( "//NAS/emul/SuperFamicom/roms", true, false, -1 );

		print( list );

		list = FileUtil.getList( "//NAS/emul/Apple2e/disk", false, true, -1 );
		
		print( list );

	}
	
	private void print( List<Path> list ) {

		for( Path string : list ) {
			System.out.println( string );
		}

	}

	@Test
	public void getExtention() {
		
		Assert.assertEquals( "txt", FileUtil.getExtention("/c:/merong.txt") );
		Assert.assertEquals( "txt", FileUtil.getExtention("/c:/merong.tXt") );
		
	}
	
}
